home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / lib.fmt / c / getitimer.man < prev    next >
Encoding:
Text File  |  1989-01-05  |  4.3 KB  |  133 lines

  1.  
  2.  
  3.  
  4. GETITIMER             C Library Procedures              GETITIMER
  5.  
  6.  
  7.  
  8. NNAAMMEE
  9.      getitimer, setitimer - get/set value of interval timer
  10.  
  11. SSYYNNOOPPSSIISS
  12.      ##iinncclluuddee <<ssyyss//ttiimmee..hh>>
  13.  
  14.      ##ddeeffiinnee IITTIIMMEERR__RREEAALL      00    //** rreeaall ttiimmee iinntteerrvvaallss **//
  15.      ##ddeeffiinnee IITTIIMMEERR__VVIIRRTTUUAALL   11    //** vviirrttuuaall ttiimmee iinntteerrvvaallss **//
  16.      ##ddeeffiinnee IITTIIMMEERR__PPRROOFF      22    //** uusseerr aanndd ssyysstteemm vviirrttuuaall ttiimmee **//
  17.  
  18.      ggeettiittiimmeerr((wwhhiicchh,, vvaalluuee))
  19.      iinntt wwhhiicchh;;
  20.      ssttrruucctt iittiimmeerrvvaall **vvaalluuee;;
  21.  
  22.      sseettiittiimmeerr((wwhhiicchh,, vvaalluuee,, oovvaalluuee))
  23.      iinntt wwhhiicchh;;
  24.      ssttrruucctt iittiimmeerrvvaall **vvaalluuee,, **oovvaalluuee;;
  25.  
  26. DDEESSCCRRIIPPTTIIOONN
  27.      The system provides each process with three interval timers,
  28.      defined in <_s_y_s/_t_i_m_e._h>.  The _g_e_t_i_t_i_m_e_r call returns the
  29.      current value for the timer specified in _w_h_i_c_h in the struc-
  30.      ture at _v_a_l_u_e.  The _s_e_t_i_t_i_m_e_r call sets a timer to the
  31.      specified _v_a_l_u_e (returning the previous value of the timer
  32.      if _o_v_a_l_u_e is nonzero).
  33.  
  34.      A timer value is defined by the _i_t_i_m_e_r_v_a_l structure:
  35.  
  36.           struct itimerval {
  37.                struct    timeval it_interval;     /* timer interval */
  38.                struct    timeval it_value;   /* current value */
  39.           };
  40.  
  41.      If _i_t__v_a_l_u_e is non-zero, it indicates the time to the next
  42.      timer expiration. If _i_t__i_n_t_e_r_v_a_l is non-zero, it specifies a
  43.      value to be used in reloading _i_t__v_a_l_u_e when the timer
  44.      expires.  Setting _i_t__v_a_l_u_e to 0 disables a timer.  Setting
  45.      _i_t__i_n_t_e_r_v_a_l to 0 causes a timer to be disabled after its
  46.      next expiration (assuming _i_t__v_a_l_u_e is non-zero).
  47.  
  48.      Time values smaller than the resolution of the system clock
  49.      are rounded up to this resolution (on the VAX, 10 mil-
  50.      liseconds).
  51.  
  52.      The ITIMER_REAL timer decrements in real time.  A SIGALRM
  53.      signal is delivered when this timer expires.
  54.  
  55.      The ITIMER_VIRTUAL timer decrements in process virtual time.
  56.      It runs only when the process is executing.  A SIGVTALRM
  57.      signal is delivered when it expires.
  58.  
  59.      The ITIMER_PROF timer decrements both in process virtual
  60.  
  61.  
  62.  
  63. Sprite v1.0             December 18, 1986                       1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. GETITIMER             C Library Procedures              GETITIMER
  71.  
  72.  
  73.  
  74.      time and when the system is running on behalf of the pro-
  75.      cess.  It is designed to be used by interpreters in statist-
  76.      ically profiling the execution of interpreted programs.
  77.      Each time the ITIMER_PROF timer expires, the SIGPROF signal
  78.      is delivered.  Because this signal may interrupt in-progress
  79.      system calls, programs using this timer must be prepared to
  80.      restart interrupted system calls.
  81.  
  82. NNOOTTEESS
  83.      Three macros for manipulating time values are defined in
  84.      <_s_y_s/_t_i_m_e._h>.  _T_i_m_e_r_c_l_e_a_r sets a time value to zero, _t_i_m_e_r_-
  85.      _i_s_s_e_t tests if a time value is non-zero, and _t_i_m_e_r_c_m_p com-
  86.      pares two time values (beware that >= and <= do not work
  87.      with this macro).
  88.  
  89. RREETTUURRNN VVAALLUUEE
  90.      If the calls succeed, a value of 0 is returned.  If an error
  91.      occurs, the value -1 is returned, and a more precise error
  92.      code is placed in the global variable _e_r_r_n_o.
  93.  
  94. EERRRROORRSS
  95.      The possible errors are:
  96.  
  97.      [EFAULT]       The _v_a_l_u_e parameter specified a bad address.
  98.  
  99.      [EINVAL]       A _v_a_l_u_e parameter specified a time was too
  100.                     large to be handled.
  101.  
  102. SSEEEE AALLSSOO
  103.      select(2), sigvec(2), gettimeofday(2)
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129. Sprite v1.0             December 18, 1986                       2
  130.  
  131.  
  132.  
  133.